package com.gzy.android_douban.ui.me;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.gzy.android_douban.R;
import com.gzy.android_douban.databinding.FragmentMeBinding;
import com.gzy.android_douban.ui.BaseFragment;
import com.gzy.android_douban.ui.MainActivity;

public class MeFragment extends BaseFragment<FragmentMeBinding> {

  FragmentMeBinding binding;

  @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    //"我的"界面 跳转-> 修改个人信息界面
    binding.imageChangeinfo.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        Intent intent = new Intent(MeFragment.this.getContext(),PersonalActivity.class);
        startActivity(intent);
      }
    });

    //"我的"界面 跳转-> 修改个人密码界面
    binding.imageChangepassword.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        Intent intent = new Intent(MeFragment.this.getContext(),PersonalActivity.class);
        startActivity(intent);
      }
    });

    //"我的"界面 跳转-> “我发布的作品”界面
    binding.imageWords.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        Intent intent = new Intent(MeFragment.this.getContext(),WorksActivity.class);
        startActivity(intent);
      }
    });

    //"我的"界面 跳转-> 我收藏的影片界面
    binding.imageCollections.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        Intent intent = new Intent(MeFragment.this.getContext(),CollectionsActivity.class);
        startActivity(intent);
      }
    });

    binding.imageComments.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        Intent intent = new Intent(MeFragment.this.getContext(),CommentsActivity.class);
        startActivity(intent);
      }
    });
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = FragmentMeBinding.inflate(inflater,container,false);
    View view = binding.getRoot();
    return view;
  }








}